#ifndef __ANIMATION_H__
#define __ANIMATION_H__
/////////////////
//include
/////////////////
#include"Texture2D.h"
#include"Rect.h"
#include"DeviceContext.h"
/////////////////
//const
/////////////////

/////////////////
//class
/////////////////
class Animation
{
public:
	Animation(Texture2D* tex,int tex_width ,int tex_height);
	~Animation();
	Vector2D GetRectSize()		const{return rect_size;}
	Vector2D GetMaxTexNum()		const{return  tex_num; }
	Vector2D GetNowTexNum()		const{return now_rect_num;}
	Texture2D* GetTexture()		const{return tex;}
	Vector2D GetAnimationSize()	const{return GetTexture()->GetSize()/GetMaxTexNum();}
	Vector2D GetCenterPos(float big_width,float big_height){return GetRectSize().GetCenter(Vector2D(big_width,big_height));}
	void SetCount(int count);
	void Loop();
	void Next();
	bool IsEnd()	const{return now_rect_num.y >= tex_num.y;}
private:
	Texture2D*	tex;
	Vector2D	rect_size;
	Vector2D	tex_num;
	Vector2D	now_rect_num;
};
#endif __ANIMATION_H__
